<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>   
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();  
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
<html>
  <head>
    <base href="<%=basePath%>">  
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	
	<meta http-equiv="description" content="This is my page">
	
	<script type="text/javascript" src="js/jquery-1.8.0.js"></script>
	<link rel="stylesheet" type="text/css" href="css/validate.css"  ></link> 
	<link rel="stylesheet" type="text/css" href="css/maintable.css" ></link>
  </head>
  
  <body>
   <div class ="div_title">
			<div class="div_titlename"> <img src="images/san_jiao.gif" ><span>商品分类维护管理</span></div>
			<div class="div_titleoper">
			</div>
		</div>
				 
			 <table class="main_table" >
			       <tr>
		 			 <th colspan="2">一级分类</th> 	<th colspan="2">二级分类</th>
			 		</tr>
			 		<c:forEach var="cate" items="${ cateList}">
			 			<tr>
			 				<td id="cate" >${cate.cateName }</td>
			 				<td>
			 					<a href="CateServlet.do?flag=updateBigCate&id=${cate.id }" onclick="return confirm('确认要修改吗')">修改</a>|
					  	 		<a href="CateServlet.do?flag=deleteBigCate&id=${cate.id }" onclick="return confirm('删除一级分类对应二级分类也会被删除，确认要删除吗')">删除</a>
			 				</td>
			 				<td>
			 					<c:forEach var="cate_sub" items="${cate.subCateList }">
			 						${cate_sub.cateName }<br />
			 					</c:forEach>
			 					
				 			</td>
				 			<td>
				 				<c:forEach var="cate_sub" items="${cate.subCateList }">
					 				<a href="CateServlet.do?flag=updateSmallCate&id=${cate_sub.id }&parentId=${cate.id}" onclick="return confirm('确认要修改吗')">修改</a>|
						  	 		<a href="CateServlet.do?flag=deleteSmallCate&id=${cate_sub.id }" onclick="return confirm('确认要删除吗')">删除</a><br/>
			 					</c:forEach>
			 				</td>
			 			</tr>
			 		</c:forEach>
			</table>
			<script>
				var msg="${msg}";
				if(msg!=""){
					alert(msg);
				}
			</script>
  </body>
</html>